package com.bolt.admin.module.log.entity;

import com.bolt.support.spring.jpa.entity.BaseUuidEntity;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.util.Date;

/**
 * Auto Generate Javadoc
 *
 * @author 日期:2020-10-16 10:59:58
 *         系统日志
 **/
@Access(AccessType.FIELD)
@Entity
@Table(name = "sys_log")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class LogEntity extends BaseUuidEntity {

    /**
     * 模块名
     */
    @Column(name = "module", length = 255)
    private String module;

    /**
     * 方法名
     */
    @Column(name = "method", length = 255)
    private String method;

    /**
     * 方法参数
     */
    @Column(name = "params", length = 65535)
    private String params;

    /**
     * 方法说明
     */
    @Column(name = "description", length = 255)
    private String description;

    /**
     * 请求ip
     */
    @Column(name = "request_ip", length = 255)
    private String requestIp;

    /**
     * 请求耗时
     */
    @Column(name = "time", length = 19)
    private Long time;

    /**
     * 用户ID
     */
    @Column(name = "user_id", length = 255)
    private String userId;
    /**
     * 用户名称
     */
    @Column(name = "user_name", length = 255)
    private String userName;

    /**
     * 地址
     */
    @Column(name = "address", length = 255)
    private String address;

    /**
     * 浏览器
     */
    @Column(name = "browser", length = 255)
    private String browser;

    /**
     * 异常详细
     */
    @Column(name = "exception_detail", length = 65535)
    private String exceptionDetail;

    /**
     * 创建日期
     */
    @Column(name = "create_time", length = 19)
    private Date createTime;

    /**
     * 是否成功
     */
    @Column(name = "success")
    private Boolean success;


}